package com.atguigu.kafka.flink;

import com.alibaba.fastjson2.JSONObject;
import com.atguigu.kafka.flink.model.Person;
import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.util.Collector;

public class PersonFlatMapFunction implements FlatMapFunction<String, Person> {

    @Override
    public void flatMap(String keyValue, Collector<Person> collector) throws Exception {
        Person person = JSONObject.parseObject(keyValue, Person.class);
        collector.collect(person);
    }
}
